﻿Ext.define('app.prm.project.ProjectController', {
    extend: 'Ext.app.ViewController',
    alias: 'controller.project',
    init: function () {
        var me = this;
    },
    onAdd: function () {
        var grid = this.getView();
        var win = Ext.create("app.prm.project.Edit", { title: '项目创建' });
        win.on("savesuccess", function (obj) {
            win.close();
            grid.store.load();
        });
        win.show();
    },
    onEditProject: function (grid, rowIndex, colIndex)
    {
        var record = grid.store.getAt(rowIndex);

        this.redirectTo('app.prm.detail.Index/' + record.data.id);


        //var view = this.getView();
        //var tabPanel = view.up('app-main').down('maincenter');
        //tabPanel.newTab(record.data.id, "app.prm.detail.Index", record.data.projectName);
    }
});
